p_height=2;
p_width=3;

output_name="/Volumes/Data/gSVN/ethernet-switch/paper/figures/sim_time.eps"

my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/speed_evaluation/wall_clock/";

num_switch_filename=paste(my_dir, "num_switch.txt", sep="");
d_filename=paste(my_dir, "sim_time_detailed.txt", sep="");
s_filename=paste(my_dir, "sim_time_simple.txt", sep="");
m_filename=paste(my_dir, "sim_time_middle.txt", sep="");

num_switch=scan(file=num_switch_filename);
d=scan(file=d_filename);
s=scan(file=s_filename);
m=scan(file=m_filename);


#quartz();
postscript(output_name, height=p_height, width=p_width, horizontal=FALSE, onefile=TRUE);

#The four numbers in the call to par are the number of lines of text reserved on the bottom, left, top and right, respectively, ps: text size, mpg: margin size for title, axis label and axis
saved_par=par(mar=c(2.2,2,0.8,0.2)+0.1, ps=8, mgp=c(1.2,0.4,0));

plot(num_switch, s, col='black', type='b', xlab=NA, ylab=NA,ylim=c(0,60), xlim=c(0, 22), xaxs='i', yaxs='i', cex=0.5);

points(num_switch, m, col='blue', pch=3, type='b', cex=0.5);

points(num_switch, d, col='red', pch=19, type='b', cex=0.5);

#title(main="Low Load Traffic", ylab=expression(paste("Packet Delay (", mu, "s)", sep="")), xlab="Packet Size (Byte)");
title(main=NA, ylab="Wall-clock Time (s)", xlab="Number of Switches");

legend('topleft', legend=c('Q1', 'Q2', 'Q3'), col=c('black','blue', 'red'), pch=c(21, 3, 19), bty='n', cex=c(1, 1,1));

par(saved_par);

dev.off()